package cn.ys.system.mapper;

import cn.ys.system.domain.Permission;
import cn.ys.base.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ys
 * @since 2023-01-03
 */
public interface PermissionMapper extends BaseMapper<Permission> {

    // 根据sn查询数据
    Permission findBySn(String permissionSn);

    // 新增permissions中间表
    void addMiddle(@Param("roleId") Long roleId, @Param("permissions") List<Long> permissions);

    // 删除中间表
    void deleteByRolesId(Long roleId);

    List<String> findByLogininfoId(Long id);
}
